Metaball Object
Technically speaking, a metaball object is a special kind of level which interprets its sub objects as a density distribution and computes a connecting boundary surface to a given density iso value. In practice, a metaball 'melts' its sub object together. The melting property makes the metaball object especially suitable for representing liquids.
The metaball tool
The first metaball tutorial shows you how to set up a metaball system using a special construction tool.
Tutorial level: Beginner
Example project: 'tutorprojects/modeling/metaball/snowman'
1. Model a snowman using some analytic spheres. As the name might indicate, a metaball object melts only spheres, so do not use other kinds of objects. However, you can freely stretch the spheres if necessary.

A snowman consisting of six analytic spheres
2. Select all spheres. Go to the 'Creation' tab of the toolbar and activate the Metaball tool. Click the 'Accept' button.

Select the spheres and activate the metaball tool
A new object called 'Metaball' appears in the object hierarchy. Open its sub hierarchy; all the original spheres are placed there.

The hierarchy of a metaball system
Controlling iso value
The default properties of the 'snowman' metaball are such that the boundary surface shrinks radically from the original spheres.

Shrunk snowman
The surface generated by a metaball level follows a given density value in space. Each sphere inside a metaball level adds its contribution to the density field: the density is zero at the outer edge of the sphere, and reaches its maximum value of one at the middle of the sphere radius.

A cross-section of a metaball system consisting of two spheres
3. Select the metaball level. Open the property window and go to the 'Spec' tab.

The metaball specific properties
The 'Iso Value' field defines the density value, which the metaball surface follows. The default 'Iso Value' is 0.5. Change it to a smaller value, say 0.1, and you will see how the snowman rapidly 'gains weight'.
Editing metaballs
The sub objects of a metaball level define its construction history. You can modify the sub objects and add new spheres, and the shape is updated automatically.
4. Select the head sphere of the snowman.
5. Activate the Transformation/Scale tool and expand the sphere. The metaball surface follows the modification.
6. Select the 'Metaball' level. Apply the 'Make Current' menu from the select window's popup.
7. Create two new analytic spheres below the snowman (legs). The spheres are inserted to the current level (= metaball), and the shape changes accordingly.
Alternatively, you can create the spheres at the root level, edit them a bit and finally drag&drop them into the metaball level.
Converting metaballs to another geometry type
Sometimes it may be desirable to convert a shape modeled using metaballs to another form. For example, a metaball surface does not have well defined UV coordinates, which can make applying textures and materials difficult. Fortunately, it is easy to convert a metaball shape to subdivision surface form. The converted shape can be edited further and textured using the SDS tools.
Let's experiment how this happens using the snowman shape:
8. If 'Metaball' is still the current level, select the root level and apply 'Make Current' to it. Then select the metaball level.
9. Go to the 'SDS' tab of the toolbar. Activate the To SDS tool. Make sure that 'Use Default Resolutions' and 'Subdivision Object' options are set. Then click 'Accept'.
10. Note that when the To SDS tool is used, it converts all sub objects to SDS objects as well. We do not need any of these sub objects converted. Hence select all the newly created SDS objects except the last one and delete them. This leaves us with the metaball SDS only.
11. You can now delete the metaball object.
12. Select the created subdivision object and open the property window. Go to the 'Spec' tab. Change 'Rendering/Type' option to 'Smoothen to Nurbs', and set 'Quality' to the minimum value 1. Close the property window.
13. The remaining step is polygon reduction by converting triangles to rectangles. To do this, select the function 'Methods/Subdivision Surface/Merge Triangles to
Quadrangles'.
A subdivision surface that consists of quads usually renders smoother than a triangular SDS mesh, because it is difficult to divide most surface forms to triangles using a symmetric pattern.
Metaball properties
The 'Spec' properties of a metaball include the following controls:
- Iso Value: The iso value of the density distribution. The generated surface follows this value.
- Channel: Defines the channel, which modifies the density distribution. If set, materials that affect the metaball are evaluated to find out the channel value.
- Resolution X, Y, Z: These gadgets define the overall accuracy of density field evaluation for metaball surface computation. The higher the resolution, the more accurate and smooth the computed surface will be. On the other hand, increased accuracy means longer computation time and higher polygon count on the resulting surface.
- Test interval: An optimization control. If the metaball system does not include small details, or if the 'Resolution' fields are so high that all details will be accurately sampled, the test interval value can be larger than one. Test interval defines how accurately the program examines points defined by the resolution values to find out places where the density really changes. If most of the space is empty, using this control can speed up metaball evaluation dramatically.
- Accuracy: Defines how accurately a detected density iso value point is computed. The higher the value, the more exactly the surface follows the given iso value. The default accuracy level zero is sufficient for most situations.
- Field: The type of density distribution. Defines how smoothly the density inside a metaball component decreases from one to zero. The following four alternatives are available:

Volume: The density drops rapidly to zero at the boundary.

Linear: The density decreases at a constant rate.

Quadric: The density decreases smoothly to zero.

Cubic: The density decreases extra smoothly to zero.
Fluid simulation using metaballs
The next tutorial example, flowing water, combines fluid dynamics and metaballs. The idea is to use a creator object to produce new metaballs (= water drops) during the animation. First read the manual chapter 'Simulation' if you are not yet familiar with the simulation tools of Realsoft 3D.
Tutorial level: Advanced
Example project: 'tutorprojects/modeling/metaball/metafluid'

1. Use the select window's 'New/Creator' to add a creator object to the hierarchy.
2. Create an analytic sphere (radius about 5 cm) and drop it into the creator level. The sphere represents a water drop.
3. Open the property window and go to the 'Phys' tab. Change the mass of the sphere to about 0.15 kilograms.
4. Switch to the 'Sim' tab. Define 'Gravity' = 'Affected' and 'Fluid Dynamics' = 'Affected' for the sphere.
5. Select the creator object. Go to the 'Spec' tab of the property window, and define (approximately) the following values:
- 'Creation Interval' = 0.15 seconds. This value defines how much water comes out from the 'water pipe'.
Note: You may have to set the Time System in the Options/Window/Animation tab to
'seconds'.
- 'Life Time' = 3 seconds. The lifetime should be long enough so that water drops have time to fall outside the rendered images.
- 'Velocity' = '0.3 0.05 0'. This value defines how fast water bursts out from the pipe.
Note that these values represent only one possible combination creating a slow water flow. You can experiment and find other values that work as well.
6. Switch to the 'Phys' tab and define a spin value '2 0 0' for the creator object. This changes the direction of water drops slightly during the animation, making it more interesting.
7. Activate the Simulation/Fan tool from the toolbar, and draw a fan object in a view window. Set 'Turbulence' = 1 from the 'Spec' tab of the property window. Then go to the 'Phys' tab and set 'Density' = 10 (dense air will enable slow motion effect). Change 'Fluid Velocity' to 1 m/s.
8. Start the Simulation/Gravity tool and draw a gravity line downward in a view window. Using the 'Spec' tab, change 'Strength' of gravity to 0.2.
9. Activate the 'Simulation' option for the parent level of the created objects.
Now it is time to play the animation to check how the water drops move. It is faster to test the simulation part now when the metaball system is not yet included. Rewind the animation and adjust the above mentioned properties if necessary.
10. Select 'New/Metaball' from the select window's popup menu. Drag and drop the creator, the fan and the gravity into its sub hierarchy.
The hierarchy of the scene is now ready and looks like this:

The structure of fluid simulation
11. We dropped the simulation components to a new hierarchy level after initial experiments. Therefore, select the 'metaball' level and using the 'Spec' tab of the property window, turn on 'Simulation' again.
12. With the metaball level selected, drag & drop the 'glass' material from the material library to the view window.
Add a nice environment and lighting to the scene before rendering the animation - the kind of environment that gives a realistic look for transparent objects.
Material controlled density field
The regular spherical density field of metaballs can be modified using a material. The following example explains the required steps.
Tutorial level: Medium
Example project: 'tutorprojects/modeling/metaball/asteroid'
1. Create a group of analytic spheres. Select them and apply the tool 'Creation/Metaball'.
2. Select the metaball level. Go to the material library and drag & drop a suitable material, for example 'granite', into a view window. The material should be such that it defines a property whose value ranges between zero and one, just like the density field of metaballs. Granite colors range between black (rgb = 0 0 0) and white (1 1 1), and is therefore suitable for our test.

Granite mapped to metaballs
3. Go back to the object hierarchy tab of the select window and activate the metaball level, which is now inside a new level. Open the property window. Go to the 'Spec' tab and select 'Color' from the 'Channel' gadget.

Color channel modifies the density field of a metaball system
4. Adjust the 'Iso Value' so that a suitable amount of the density field generates a surface around it.

An asteroid defined by two metaballs and a granite material
Notes:
- The total density field is the product of the spherical density fields and the material defined density field.
- In the example above, 'granite' changed both the color and the density field of the metaballs. You can also create a material, which assigns a density value to a suitable user defined channel. (e.g. 'my_density') Using such a specialized channel-material pair changes only the density field, not the color or other surface properties.